/******************************************************
*  Copyright(c) pages.ilovezxl.top
*  FileName : can.c
*  Author : rivulet.dave
*  Description : HAL CAN文件
*  Data : 2020-07-26
******************************************************/


/*********************************************************************
 * INCLUDES
 */

#include "stdrope.h"
#include "util.h"

#include "hallib.h"
#include "halagent.h"

#if (HAL_CAN == _ENABLE)
#include "can.h"

#if (HAL_PRODUCER == _HAL_LINUX_)
#include "can_linux.h"
#endif

/*********************************************************************
 *  EXTERNAL VARIABLES
 */

/*********************************************************************
 * MACROS
 */

/*********************************************************************
 * TYPES
 */

typedef struct _hal_can_cb
{
    MOD_INFO_S stModInfo;
    HAL_OPER_S *pstCanBaseOper;
} HAL_CAN_CB_S;

/*********************************************************************
 * FUNCTIONS DECLARE
 */

/*********************************************************************
 * VARIABLES
 */

static HAL_CAN_CB_S s_stCanHandlers = { 0 };

/*********************************************************************
 * FUNCTIONS
 */

/**
 *   @Description: 模块初始化
 *   @param  : NA
 *   @return : 模块描述符
 */
hd_t CAN_Init(void)
{
#if (HAL_PRODUCER == _HAL_LINUX_)
    s_stCanHandlers.pstCanBaseOper = CAN_ObjNewByLinux();
#endif
    return (hd_t)(s_stCanHandlers.pstCanBaseOper);
}

/**
 *   @Description: 模块退出
 *   @param  : NA
 *   @return : NA
 */
void CAN_Exit(void)
{
#if (HAL_PRODUCER == _HAL_LINUX_)
    CAN_ObjDeleteByLinux();
#endif
    s_stCanHandlers.pstCanBaseOper = NULL;
}

#endif  //(HAL_CAN == _ENABLE)

/************************************** The End Of File **************************************/

